<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
        
            background-color: #f0f0f0;
        }
        img {
            width: 40px;
            height: 40px;
            float: left;
        }
        .bfc {
            overflow: hidden; /*触发BFC*/
        }
    </style>
</head>
<body>
    <div class="container bfc ">
        <img src="../images/logo.png" alt="">
        <p class="bfc" >这是一段测试文字</p>
    </div>
</body>
</html>